//
//  LYQConsultingHeaderCell.m
//  ZCProject
//
//  Created by Zheng on 2016/12/13.
//  Copyright © 2016年 Zheng. All rights reserved.
//

#import "LYQConsultingFooterCell.h"

@implementation LYQConsultingFooterCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self == nil) {
        return nil;
    }
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    [self.contentView addSubview:self.deleteBtn];
    [self.contentView addSubview:self.replyBtn];
    [self.contentView addSubview:self.lineView];
    
    [self layoutSubviewsInContentView];
    
    return self;
}

#pragma mark - layout subviews
- (void)layoutSubviewsInContentView {
    
    [_deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.equalTo(self);
        make.width.equalTo(@((kMS_Width-0.5)/2));
    }];
    
    [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_deleteBtn.mas_right);
        make.top.bottom.equalTo(self);
        make.width.equalTo(@(0.5));
    }];
    
    [_replyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_lineView.mas_right);
        make.top.bottom.right.equalTo(self);
    }];
    
}

#pragma mark - load subviews
- (UIButton *)deleteBtn {
    
    if (_deleteBtn) {
        return _deleteBtn;
    }
    
    _deleteBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [_deleteBtn setImage:[UIImage imageNamed:@"skgwicon"] forState:UIControlStateNormal];
    [_deleteBtn setTitle:@"删除" forState:UIControlStateNormal];
    [_deleteBtn setTitleColor:kHexadecimal(@"666666") forState:UIControlStateNormal];
    [_deleteBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 7, 0, 0)];
    _deleteBtn.titleLabel.font = kWFont(15);
    
    return _deleteBtn;
}

- (UIButton *)replyBtn {
    
    if (_replyBtn) {
        return _replyBtn;
    }
    
    _replyBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [_replyBtn setImage:[UIImage imageNamed:@"skgwicon"] forState:UIControlStateNormal];
    [_replyBtn setTitle:@"回复" forState:UIControlStateNormal];
    [_replyBtn setTitleColor:kHexadecimal(@"666666") forState:UIControlStateNormal];
    [_replyBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 7, 0, 0)];
    _replyBtn.titleLabel.font = kWFont(15);
    
    return _replyBtn;
}

- (UIView *)lineView {
    
    if (_lineView) {
        return _lineView;
    }
    
    _lineView = [[UIView alloc] init];
    _lineView.backgroundColor = RGB(200, 199, 204, 1);
    
    return _lineView;
}


@end
